# 定义接口对象层
import requests


class ZshjUserMengerApi():


    # 定义添加用户方法
    def add_user(self,req_header,req_body):
        resp=requests.get(url="http://192.168.43.115:1111/admin/system/sysUser/save",
                          headers=req_header,
                          json=req_body)

        return resp

    # 定义获取用户方法
    def query_user(self, user_id, req_header):
        resp = requests.get(url="http://192.168.43.115:1111/admin/system/sysUser/get/" + user_id,
                            headers=req_header)

        return resp

    # 定义更新用户方法
    def update_user(self, req_header, req_body):
        resp = requests.put(url="http://192.168.43.115:1111/admin/system/sysUser/update",
                            headers=req_header,
                            json=req_body)

        return resp

    # 定义删除用户方法
    def delete_user(self, user_id, req_header):
        resp = requests.delete(url="http://192.168.43.115:1111/admin/system/sysUser/remove/" + user_id,
                               headers=req_header)

        return resp



if __name__ == '__main__':
    # 创建实例化
    zshjuser = ZshjUserMengerApi
    # 准备请求头
    req_header = {
        "token":"eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJScgwN8dANDXYNUtJRSq0oULIyNDcwNjEytDA11FEqLU4t8kwBikGYeYm5qUAtiSm5mXlKtQCw7zrsQgAAAA.Mp1VB6QXLhSYsZr1qIZ0dFVLew3scGaLSKVQt1jwwvnxuZJA1BfYG2Iw_OFmgXsyWjbA57bjvTX0c8BQLFt1iQ"}
